<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>优家购房系统 - 租赁合同信息更新</title>
	<script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
	<link rel="stylesheet" href="css/main.css">
	<link rel="stylesheet" href="lib/font-awesome/css/font-awesome.css">
	
<script type="text/javascript">
	//根据传入的值默认选中option
	$(document).ready(function(){
		var payWay = '${lc.lc_pay_way}';
		var contractState = '${lc.lc_contract_state}';
		$("#test option").each(function(){
			//alert($(this).val());
			if($(this).val()==payWay){
				$(this).attr("selected",true);
			}
		});
		$("#test2 option").each(function(){
			//alert($(this).val());
			if($(this).val()==limit){
				$(this).attr("selected",true);
			}
		});
	});
</script>

</head>
<body style="background:url('image/bg3.jpg');background-size:cover;">
<div class="box">
	<h3>更新租赁合同信息</h3>
	<form action="LeaseContractServlet2?method=update" method="post">
		<input type="hidden" name="id" value="${lc.lc_id }">
		<table class="form-table">
		<tr>
			<td>合同号</td>
			<td colspan="3" class="control">
				<input type="text" name="lcNumber" value="${lc.lc_contract_number }">
			</td>
		</tr>
		<tr>
			<td>房屋id号</td>
			<td colspan="3" class="control">
				<input type="text" name="flatId" value="${lc.flat_id }">
			</td>
		</tr>
		<tr>
			<td>租户id号</td>
			<td colspan="3" class="control">
				<input type="text" name="lesseeId" value="${lc.tenant_id }">
			</td>
		</tr>
		<tr>
			<td>合同日期</td>
			<td colspan="3" class="control">
				<input type="text" name="lcDate" value="${lc.lc_contract_date }" class="Wdate" onClick="WdatePicker()">
			</td>
		</tr>
		<tr>
			<td>租赁开始时间</td>
			<td colspan="3" class="control">
				<input type="text" name="lcStartDate" value="${lc.lc_contract_start_date }" class="Wdate" onClick="WdatePicker()">
			</td>
		</tr>
		<tr>
			<td>租赁结束时间</td>
			<td colspan="3" class="control">
				<input type="text" name="lcEndDate" value="${lc.lc_contract_end_date }" class="Wdate" onClick="WdatePicker()">
			</td>
		</tr>
		<tr>
			<td>房租总额</td>
			<td colspan="3" class="control">
				<input type="text" name="totalRent" value="${lc.lc_total_rent }">
			</td>
		</tr>
		<tr>
			<td>付款方式</td>
			<td colspan="3" class="control">
				<select name="payWay" id="test">
					<option value="0">月付</option>
					<option value="1">半年付</option>
					<option value="2">年付</option>
					<option value="3">季付</option>
				</select>
			</td>
		</tr>
		<tr>
			<td>押金</td>
			<td colspan="3" class="control">
				<input type="text" name="deposit" value="${lc.lc_deposit }">
			</td>
		</tr>
		<tr>
			<td>付款期数</td>
			<td colspan="3" class="control">
				<input type="text" name="periodOfPayment" value="${lc.lc_period_payment }">
			</td>
		</tr>
		<tr>
			<td>合同签署人</td>
			<td colspan="3" class="control">
				<input type="text" name="lcSigner" value="${lc.lc_contract_signer }">
			</td>
		</tr>
		<tr>
			<td>合同状态</td>
			<td colspan="3" class="control">
				<select name="contractState" id="test2">
					<option value="1">正常</option>
					<option value="0">已失效</option>
				</select>
			</td>
		</tr>
	</table>
		<div class="buttons">
			<input class="btn btn-primary va-bottom" type="submit" value="保存">&nbsp;&nbsp;
			<a class="btn btn-default" href="javascript:history.go(-1)">返回</a>
		</div>
	</form>
</div>
</body>
</html>